/**
 * 
 */
package com.primestone.cim.executeenddevicecontrols;

import java.util.ArrayList;
import java.util.List;

import com.primestone.cim.util.StringUtil;
import com.primestone.cim.util.enums.EndDeviceEventEnum;

/**
 * @author cesar.mateus
 *
 */
public class ControlTypeComposer {
	
	private static final EndDeviceEventEnum.Domain ELECTRIC_METER = EndDeviceEventEnum.Domain._3;
	private static final EndDeviceEventEnum.DomainPart RCD_SWITCH = EndDeviceEventEnum.DomainPart._31;
	private static final EndDeviceEventEnum.Type COMMAND = EndDeviceEventEnum.Type._6;
	
	private static final EndDeviceEventEnum.Index CONNECTED = EndDeviceEventEnum.Index._42;
	private static final EndDeviceEventEnum.Index DISCONNECTED = EndDeviceEventEnum.Index._68;

	/**
	 * 3.31.6.42
	 * @return
	 */
	public static List<String> getConnectCommandType() {
		List<String> info = new ArrayList<String>(2);
		info.add( new StringBuilder() 
		.append(ELECTRIC_METER.getDomainValue())
		.append(StringUtil.DOT)
		.append(RCD_SWITCH.getDomainPart())
		.append(StringUtil.DOT)
		.append(COMMAND.getTypeValue())
		.append(StringUtil.DOT)
		.append(CONNECTED.getIndex())				
		.toString() );
		
		info.add( new StringBuilder() 
		.append(ELECTRIC_METER.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(RCD_SWITCH.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(COMMAND.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(CONNECTED.getEnumeration())
		.toString() );
		return info;
	}

	/**
	 * 3.31.6.68
	 * @return
	 */
	public static List<String> getDisconnectCommandType() {
		List<String> info = new ArrayList<String>(2);
		info.add( new StringBuilder() 
		.append(ELECTRIC_METER.getDomainValue())
		.append(StringUtil.DOT)
		.append(RCD_SWITCH.getDomainPart())
		.append(StringUtil.DOT)
		.append(COMMAND.getTypeValue())
		.append(StringUtil.DOT)
		.append(DISCONNECTED.getIndex())				
		.toString() );
		
		info.add( new StringBuilder() 
		.append(ELECTRIC_METER.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(RCD_SWITCH.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(COMMAND.getEnumeration())
		.append(StringUtil.UNDERSCORE)
		.append(DISCONNECTED.getEnumeration())
		.toString() );
		return info;
	}
}
